package com.ask.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_voucher")
public class Voucher {

    /**
     * 优惠卷状态 1上架 2下架 3过期
     */
    public static Integer ON_SALE = 1;
    public static Integer OFF_SALE = 2;
    public static Integer EXPIRED = 3;


    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private Long shopId;
    private String title;
    private String subTitle;
    private String rules; // 使用规则
    private Long payValue; // 支付金额
    private Long actualValue; // 抵扣金额
    private Integer type; // 类型：0普通卷，1秒杀卷
    private Integer status; // 状态：1上架 2下架 3过期
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    @TableField(exist = false)
    private LocalDateTime beginTime;
    @TableField(exist = false)
    private LocalDateTime endTime;
    @TableField(exist = false)
    private Integer stock;

}
